//
//  JKRFriendTrendsViewController.m
//  百思不得姐
//
//  Created by Lucky on 16/2/29.
//  Copyright © 2016年 Lucky. All rights reserved.
//

#import "JKRFriendTrendsViewController.h"
#import "JKRRecommendViewController.h"

@interface JKRFriendTrendsViewController ()

@property (nonatomic, strong) UILabel *centerLabel;

@property (nonatomic, strong) UIImageView *topImageView;

@property (nonatomic, strong) UIButton *loginButton;

@end

@implementation JKRFriendTrendsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = @"我的关注";
    
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"friendsRecommentIcon"] highLightedImage:[UIImage imageNamed:@"friendsRecommentIcon-click"] target:self action:@selector(friendsClick)];
    
    self.view.backgroundColor = JKRGlobalBackgroudColor;
    
    [self.view addSubview:self.centerLabel];
    [self.view addSubview:self.topImageView];
    [self.view addSubview:self.loginButton];
    
    [self setChildViews];
    
}

- (void)friendsClick
{
    JKRLogFunc;
    [self.navigationController pushViewController:[[JKRRecommendViewController alloc] init] animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

- (void)setChildViews
{
    [self.centerLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.view);
        make.width.equalTo(@270);
    }];
    
    [self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.centerLabel);
        make.bottom.equalTo(self.centerLabel.mas_top).offset(-40);
        make.height.equalTo(@40);
        make.width.equalTo(@40);
    }];
    
    [self.loginButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.centerLabel.mas_bottom).offset(40);
        make.centerX.equalTo(self.centerLabel);
        make.height.equalTo(@35);
        make.width.equalTo(@200);
    }];
}

- (UILabel *)centerLabel
{
    if (!_centerLabel) {
        _centerLabel = [[UILabel alloc] init];
        _centerLabel.text = @"快快登录吧, 关注百思最in牛人\n好友动态让你过把瘾儿~\n欧耶~~~~!";
        _centerLabel.numberOfLines = 0;
        _centerLabel.textAlignment = NSTextAlignmentCenter;
        _centerLabel.font = [UIFont systemFontOfSize:17];
        _centerLabel.textColor = JKRColor(153, 102, 51, 1.0);
    }
    return _centerLabel;
}

- (UIImageView *)topImageView
{
    if (!_topImageView) {
        _topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"header_cry_icon"]];
    }
    return _topImageView;
}

- (UIButton *)loginButton
{
    if (!_loginButton) {
        _loginButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_loginButton setTitle:@"立即登录注册" forState:UIControlStateNormal];
        [_loginButton setBackgroundImage:[UIImage imageNamed:@"friendsTrend_login"] forState:UIControlStateNormal];
        [_loginButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
        [_loginButton setTitleShadowColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
        [_loginButton setBackgroundImage:[UIImage imageNamed:@"friendsTrend_login_click"] forState:UIControlStateHighlighted];
        [_loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
    }
    return _loginButton;
}

@end
